<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	<h4 class="modal-title"><font color="red">用户信息</font>&nbsp;</h4>
</div>
<div class="modal-body">
	<form class="form-horizontal" role="form" id="editForm1">
		<input type="hidden" name="formToken" id="formToken">
		<input type="hidden" name="doCode" value="dymicSql">
		<input type="hidden" name="pageName" value="regIndexT.jsp">
		<input type="hidden" name="formName" value="editForm1">
		<input type="hidden" name="uctUser.w_userId" id="userId" data-name="uctUser.userId">
		<input type="hidden" name="member.w_memberId" id="memberId" data-name="member.memberId">
		<input type="hidden" name="uctUser.userPass" id="md5Pass" value=""/>
		<!-- <input type="hidden" name="randCodeMark" value="F"> -->
		<input type="hidden" name="uctUser.deptId" id="userForm_deptId">
		<input type="hidden" name="uctUser.orgId" id="userForm_orgId">
		<input type="hidden" name="uctUser.userType" value="member">
		<input type="hidden" name="uctUser.delStatus" value="0">
		<div class="box-body" id="userFormData">
			<div class="form-group">
			   <label for="inputOrgCname" class="col-sm-3 control-label" >登录账号：</label>
			   <div class="col-sm-8">
			       <input type="text" class="form-control clean" id="editForm1_login_username" data-name="uctUser.userEname" name="uctUser.userEname" style="color: rgb(0, 0, 0);" readonly="readonly">
			   </div>
			</div>
			<div class="form-group">
			    <label class="col-sm-3 control-label">用户名称：</label>
			    <div class="col-sm-8">
			         <input type="text" class="form-control clean"  name="uctUser.userCname" data-name="uctUser.userCname" required placeholder="必填项">
			    </div>
			</div>
			<div id="if_update_pass_div" class="form-group" style="display: none">
			    <label class="col-sm-3 control-label">是否修改密码：</label>
			    <div class="col-sm-8">
			       <input type="radio" name="if_update_pass" id="if_update_pass" value="1" onclick="setUserPass('1')"/>是
                   <input type="radio" name="if_update_pass" id="if_update_pass" value="0" checked="checked" onclick="setUserPass('0')"/>否
			    </div>
			</div>
			<div id="edit_user_pass">
				<div class="form-group">
				     <label class="col-sm-3 control-label">密码：</label>
				     <div class="col-sm-8">
				         <input type="password" class="form-control clean" id="password">
				     </div>
				</div>
				<div class="form-group">
				     <label class="col-sm-3 control-label">确认密码：</label>
				     <div class="col-sm-8">
				           <input type="password" class="form-control clean" id="password2">
				     </div>
				 </div>
			 </div>
			 <div class="form-group">
				<label class="col-sm-3 control-label"><font color="red" style="vertical-align: middle;">*</font>用户类型：</label>
				<div class="col-sm-8">
					<select id="customerType" name="uctUser.customerType" data-name="uctUser.customerType" class="form-control" onchange="changeMemberType(this);" disabled="disabled">
						<option value="">--请选择--</option>
						<option value="person">个人</option>
						<option value="org">机构</option>
					</select>
					<!--  <input type="text" class="form-control clean"  name="userCname" data-name="userCname"  placeholder="必填项">-->
				</div>
			</div>
			 
			 <div class="form-group">
			      <label class="col-sm-3 control-label">手机：</label>
			      <div class="col-sm-8">
			           <!-- <input type="text" class="form-control" name="mobile" data-name=mobile placeholder="非必填项">-->
			           <!-- <input type="text" onchange="checkUserMobile('frm1',1)" value="" class="form-control clean" maxlength="11" name="uctUser.mobile" data-name="uctUser.mobile" id="frm1_login_mobile" tip="请输入手机号码" placeholder="请输入手机号码" abc="1" style="color: rgb(0, 0, 0);" disabled="disabled"> -->
			     	   <input type="text" value="" class="form-control clean" maxlength="11" name="uctUser.mobile" data-name="uctUser.mobile" id="frm1_login_mobile" tip="请输入手机号码" placeholder="请输入手机号码" abc="1" style="color: rgb(0, 0, 0);" disabled="disabled">
			      </div>
			 </div>
			 <div class="form-group">
			       <label class="col-sm-3 control-label">联系电话：</label>
			       <div class="col-sm-8">
			            <input type="text" class="form-control clean" name="uctUser.phone" data-name="uctUser.phone" placeholder="非必填项" >
			       </div>
			 </div>
			 <div class="form-group">
			      <label class="col-sm-3 control-label">状态：</label>
			      <div class="col-sm-8">
			           <input type="radio" value="1" name="uctUser.userStatus"/> 启用 
                       <input type="radio" value="0" name="uctUser.userStatus"/> 停用
			      </div>
			  </div>
			  
			  <!-- ORG INFORMATION START!!! -->
						  	<div id="_org">
						  		<div class="form-group">
									<label for="lastname" class="col-sm-3 control-label">公司名称：</label>
									<div class="col-sm-8">
							      		<input type=" " class="form-control clean" name="uctUser.company" data-name="uctUser.company" placeholder="">
							    	</div>
							  	</div>
						  		<div class="form-group">
									<label for="lastname" class="col-sm-3 control-label">注册地：</label>
									<div class="col-sm-8">
							      		<input type=" " class="form-control clean" name="member.address" data-name="member.address" placeholder="">
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">注册资本（元）：</label>
								    <div class="col-sm-8">
							      		<input type=" " class="form-control clean" name="member.regCapital" data-name="member.regCapital" placeholder="">
							    	</div>
							  	</div> 
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">成立时间：</label>
								    <div class="col-sm-8">
							      		<div class="input-append date form_datetime" id="datepicker">
										    <input style="width:80%" id="regTime" name="member.regTime" data-name="member.regTime" type="text" class="form-control clean" value="" >
										    <span class="add-on"><i class="fa fa-calendar"></i></span>
										</div>
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">法定代表人：</label>
								    <div class="col-sm-8">
							      		<input type=" " class="form-control clean" name="member.legalPerson" data-name="member.legalPerson" placeholder="">
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">所属行业：</label>
								    <div class="col-sm-8">
							      		<select id="strFiftyThree" name="member.strFiftyThree"  data-name="member.strFiftyThree" data-dict="strFiftyThree" class="form-control clean">
						                </select>
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">企业类型：</label>
								    <div class="col-sm-8">
							      		<select id="enterpriseType" name="member.enterpriseType" data-name="member.enterpriseType" data-dict="enterpriseType" class="form-control clean">
						                </select>
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">组织机构代码：</label>
								    <div class="col-sm-8">
							      		<input type=" " class="form-control clean" name="member.orgCode" data-name="member.orgCode" placeholder="新版三证合一单位请输入营业执照号码">
							    	</div>
							  	</div>
							  	
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">经营范围：</label>
								    <div class="col-sm-8">
							      		<textarea type="text" id="str100_4" name="member.strFiftyOne" data-name="member.strFiftyOne" class="form-control clean" cols="45" rows="5" maxlength="100"  placeholder="如：商务咨询、商务信息咨询" ></textarea>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								    <div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件1：交易参与人（企业）资格申请表： <a target="_blank" data-name="member.strHundredFour">下载</a></span>
								    </div>
								    <div id="filespan_21" class="col-sm-3">
						              	<label onclick="addUploadFile(21);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_21_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_21' objId='' isSub='F' name="member.strHundredFour" data-name="member.strHundredFour" type="hidden"/>
						              	<label id="fileUpText_21_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								    <div class="col-sm-8" >
									    <span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件2：企业组织机构（或三证合一）扫描件：<a target="_blank" data-name="member.strHundredFive">查看</a></span>
									    <img id="fileUpText_22_showImg" src="${ctx}/images/def.jpg" class="clean" data-name="member.strHundredFive" style="margin-left: 160px;width:120px;height:80px;"/>
								    </div>
								    <div id="filespan_22" class="col-sm-3">
						              	<label onclick="addUploadFile(22);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_22_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_22' objId='' isSub='F' name="member.strHundredFive" data-name="member.strHundredFive" type="hidden"/>
						              	<label id="fileUpText_22_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								    <div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件3：交易代表推荐函： <a target="_blank" data-name="member.strHundredSix">下载</a></span>
								    </div>
								    <div id="filespan_23" class="col-sm-3">
						              	<label onclick="addUploadFile(23);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_23_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_23' objId='' isSub='F' name="member.strHundredSix" data-name="member.strHundredSix" type="hidden"/>
						              	<label id="fileUpText_23_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								   	<div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件4：交易代表身份证复印件正面照：<a target="_blank" data-name="member.strHundredTwo">查看</a></span>
								    	<img id="fileUpText_24_showImg" src="${ctx}/images/def.jpg" class="clean" data-name="member.strHundredTwo" style="margin-left: 160px;width:120px;height:80px;"/>
								    </div>
								    <div id="filespan_24" class="col-sm-3">
						              	<label onclick="addUploadFile(24);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_24_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_24' objId='' isSub='F' name="member.strHundredTwo" data-name="member.strHundredTwo" type="hidden"/>
						              	<label id="fileUpText_24_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								    <div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件5：交易代表身份证复印件反面照：<a target="_blank" data-name="member.strHundredThree">查看</a></span>
								    	<img id="fileUpText_25_showImg" src="${ctx}/images/def.jpg" class="clean" data-name="member.strHundredThree" style="margin-left: 160px;width:120px;height:80px;"/>
								    </div>
								    <div id="filespan_25" class="col-sm-3">
						              	<label onclick="addUploadFile(25);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_25_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_25' objId='' isSub='F' name="member.strHundredThree" data-name="member.strHundredThree" type="hidden"/>
						              	<label id="fileUpText_25_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
								    <div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件6：《入场交易协议书》（签字盖章）：<a target="_blank" data-name="member.strHundredSeven">下载</a></span>
								    </div>
								    <div id="filespan_26" class="col-sm-3">
						              	<label onclick="addUploadFile(26);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_26_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_26' objId='' isSub='F' name="member.strHundredSeven" data-name="member.strHundredSeven" type="hidden"/>
						              	<label id="fileUpText_26_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group ">
							  		<div class="col-sm-8" >
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件7：《风险提示函》（签字盖章）：<a target="_blank" data-name="member.strHundredEight">下载</a></span>
								    </div>
								    <div id="filespan_27" class="col-sm-3">
						              	<label onclick="addUploadFile(27);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_27_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse clean" >开始上传</label>
										<input id='fileUpText_27' objId='' isSub='F' name="member.strHundredEight" data-name="member.strHundredEight" type="hidden"/>
						              	<label id="fileUpText_27_msg" style="color:red;"></label>
							    	</div>
							  	</div>
						  	</div>
						  	<!-- ORG INFORMATION END!!!! -->
						  	<!-- PERSON INFORMATION START!!!! -->
						  	<div id="_person">
							    <div class="form-group">
								      <label class="col-sm-3 control-label">用户性别：</label>
								      <div class="col-sm-8"> 
								         <input type="radio" value="F" name="uctUser.userSex"/> 女 
	                     				 <input type="radio" value="M" name="uctUser.userSex"/> 男
								      </div>
								</div>
						  	
						  		<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label"><span style="color:red">*</span>身份证号：</label>
								    <div class="col-sm-8">
							      		<input type="text" class="form-control clean" id="certNo" name="uctUser.certNo" data-name="uctUser.certNo" tip="请输入正确的身份证号码" placeholder="请输入身份证件号码">
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">工作单位：</label>
								    <div class="col-sm-8">
							      		<input type="text" class="form-control clean" id="company" name="uctUser.company" data-name="uctUser.company" placeholder="">
							    	</div>
							  	</div>
							  	<div class="form-group">
								    <label for="lastname" class="col-sm-3 control-label">职务：</label>
								    <div class="col-sm-8">
							      		<input type="text" class="form-control clean" id="str50_2" name="member.strFiftyTwo" data-name="member.strFiftyTwo" placeholder="如：某某公司、自由职业">
							    	</div>
							  	</div>
							  	<div class="form-group row">
							  		<div class="col-sm-8 ">
									    <span for="lastname" style="margin-left: 100px;" >&nbsp;&nbsp;&nbsp;&nbsp;附件1：交易参与人（自然人）资格申请表： <a target="_blank" data-name="member.strHundredFour">下载</a></span>
							  		</div>
								    <div id="filespan_11" class="col-sm-3">
						              	<label onclick="addUploadFile(11);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_11_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
										<input id='fileUpText_11' objId='' isSub='F' name="member.strHundredFour" data-name="member.strHundredFour" type="hidden" class="clean"/>
						              	<label id="fileUpText_11_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group row">
							  		<div class="col-sm-8 ">
								    	<span for="lastname" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;附件2：交易参与人（自然人）风险评估问卷：<a target="_blank" data-name="member.strHundredFive">下载</a></span>
								    </div>
								    <div id="filespan_12" class="col-sm-3">
						              	<label onclick="addUploadFile(12);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_12_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
										<input id='fileUpText_12' objId='' isSub='F'  name="member.strHundredFive" data-name="member.strHundredFive" type="hidden" class="clean"/>
						              	<label id="fileUpText_12_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group row">
							  		<div class="col-sm-8" >
									    <span for="lastname" style="margin-left: 100px;display:block;">&nbsp;&nbsp;&nbsp;&nbsp;附件3：身份证复印件正面照：<a target="_blank" data-name="member.strHundredTwo">查看</a></span>
								    	<img id="fileUpText_13_showImg" src="${ctx}/images/def.jpg" data-name="member.strHundredTwo" class="" style="margin-left: 160px;width:120px;height:80px;"/>
							  		</div>
								    <div id="filespan_13" class="col-sm-3">
						              	<label onclick="addUploadFile(13);" for='uploadFileInput' class="btn btn-warning">选择文件</label>
										<label id='fileUpText_13_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
										<input id='fileUpText_13' objId='' isSub='F' name="member.strHundredTwo" data-name="member.strHundredTwo" type="hidden" class="clean"/>
						              	<label id="fileUpText_13_msg" style="color:red;"></label>
							    	</div>
							  	</div>
							  	<div class="form-group row">
								    <div class="col-sm-8" >
									    <span for="lastname" style="margin-left: 100px;display:block;">&nbsp;&nbsp;&nbsp;&nbsp;附件4：身份证复印件反面照：<a target="_blank" data-name="member.strHundredThree">查看</a></span>
								    	<img id="fileUpText_14_showImg" src="${ctx}/images/def.jpg" class="clean" data-name="member.strHundredThree" style="margin-left: 160px;width:120px;height:80px;"/>
							  		</div>
								    <div id="filespan_14" class="col-sm-3">
						              	<label onclick="addUploadFile(14);" for='uploadFileInput' class="btn btn-warning">选择图片</label>
										<label id='fileUpText_14_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
										<input id='fileUpText_14' objId='' isSub='F' name="member.strHundredThree" data-name="member.strHundredThree" type="hidden"/>
										<label id="fileUpText_14_msg" style="color:red;"></label> <!--不要信息提示，就去掉此 -->
							    	</div>
							  	</div>
							  	<div class="form-group row">
								    <div class="col-sm-8" >
									    <span for="lastname" style="margin-left: 100px;display:block;">&nbsp;&nbsp;&nbsp;&nbsp;附件5：近期个人金融资产证明材料扫描件:<a target="_blank" data-name="member.strHundredSix">查看</a></span>
								    	<img id="fileUpText_15_showImg" src="${ctx}/images/def.jpg" class="clean" data-name="member.strHundredSix" style="margin-left: 160px;width:120px;height:80px;"/>
							  		</div>
								    <div id="filespan_15" class="col-sm-3">
						              	<label onclick="addUploadFile(15);" for='uploadFileInput' class="btn btn-warning">选择图片</label>
										<label id='fileUpText_15_subbtn' onclick="$.toolsupload.uploadSubmit(this);" style='display:none;' class="fDef_Btnse" >开始上传</label>
										<input id='fileUpText_15' objId='' isSub='F' name="member.strHundredSix" class="clean" data-name="member.strHundredSix" type="hidden"/>
										<label id="fileUpText_15_msg" style="color:red;"></label> <!--不要信息提示，就去掉此 -->
							    	</div>
							  	</div>
						  	</div>
						  	<!-- PERSON INFOMATION END!!!!! -->
			  
			  
			  <div class="box-footer">
			        <button type="button" class="btn btn-primary pull-left" onclick="cannel('my_modal_edit');">取消</button>
			        <button type="button" class="btn btn-primary pull-right" onclick="edit('editForm1');">提 交</button>
			  </div>
	</form>
</div> 
<iframe name='uploadIframe' id='uploadIframe' frameborder='0' height='0' width='0'></iframe>
<div id="uploadIframeDefDiv" style="height:0px;" ></div>
<script>

$(function(){
	var dateObject = $('#datepicker').datepicker( {
		language : 'zh-CN',
		//inline: true,
		todayBtn : "linked",
		format : "yyyy-mm-dd",
	    autoclose: true
	});
	
	//修改注册机构时，校验机构成立时间要早于当前时间
	 var regTime = $('#regTime').datepicker({
			language : 'zh-CN',
			//inline: true,
			todayBtn : "linked",//显示今天
			format : "yyyy-mm-dd",
		    autoclose : true,
		    todayHighlight : true,  //高亮
			endDate : new Date()  //小于今天
		});
});


function toEdit(userId){
	if(strUtil.isNull(userId)){
		layer.alert('请先选中一条数据！', {skin: 'layui-layer-molv',closeBtn: 0 });
		return;
	}else{
		
	   $("#if_update_pass_div").show();
	   $("#_org").hide();
	   $("#edit_user_pass").hide();
	 //  $("#if-sysFlag").hide();
	   $.ajax({
		   type:'get',
		   url:common_info_url,//  
		   data:{'uctUser.w_userId':id,'doCode':'dymicSql','pageName':'regIndexT.jsp','formName':'searchForm1'},
		   dataType:'json',
		   success:function(myData){
			   cleanData('userFormData');
			   FormUtil.loadView("uctUser", myData.uctUser);
			   FormUtil.loadView("member", myData.member);
			   $("#userId").val(myData.uctUser.userId);//将Id值重新赋上
			   $("#memberId").val(myData.member.memberId);
			   var customerType = myData.uctUser.customerType;
				if("org"==customerType){
					$("#_org").show();
					$("#_person").remove();
				}
				if("person"==customerType){
					$("#_org").remove();
					$("#_person").show();
				}
				if(""==customerType){
					$("#_org").hide();
					$("#_person").hide();
				}
			   loadFirstDictJson('Industrycode','strFiftyThree','${ctx}',myData.member.strFiftyThree);//所属行业
			   loadFirstDictJson('buyerjjlx','enterpriseType','${ctx}',myData.member.enterpriseType);//企业类型
			  
				DictUtil.checkRadioDict("uctUser.userStatus", myData.uctUser.userStatus);
				DictUtil.checkRadioDict("uctUser.userSex", myData.uctUser.userSex);
			   getObjInfo(myData);
		   }
	   });
	}
}

function del(){

	if(strUtil.isNull(id)){
		layer.alert('请先选中一条数据！', {skin: 'layui-layer-molv',closeBtn: 0});
		return;
	}else{
	var index_submit = layer.confirm("您确认删除用户["+userCname+"]吗？", {btn: ['确认','取消'],closeBtn: 0,offset: '220px'}
		, function(){
			layer.close(index_submit);
			var formToken = $("#formToken").val();
			$.ajax({ type:'post', url:del_url,
			    data:{'userId':id,'formToken':formToken}, dataType:'json',
			    success: function(myData){
			    	if(myData.flag=='T'){
			    		layer.alert('删除成功！', { skin: 'layui-layer-molv',closeBtn: 0 });
			    		refresh();
			    	}
			  	}
			});	
		
		});
	}
}

function add(formId){
		var pass = $("#password").val();
	    var pass2 = $("#password2").val();
	    if($.trim(pass) != $.trim(pass2)){
	    	$.messager.alert('错误提示', '两次输入密码不一致!', 'error');
	    	return;
	    }else{
	    	$("#md5Pass").val(pass.md5());
	    }
	_submit(formId);
}
function edit(formId){
    	var item = $('input[name="if_update_pass"]:checked').val();
		if("1" == item){
		    var pass = $("#password").val();
	    	var pass2 = $("#password2").val();
	    	
	    	if($.trim(pass) != $.trim(pass2)){
	    		layer.alert('两次输入的密码不一致！', { skin: 'layui-layer-molv',closeBtn: 0 });
	    		return;
	    	}else{
	    			$("#md5Pass").val(pass.md5());
	    	     }
		}
	_submit(formId);
}
function _submit(formId){
   $.ajax({type:'post', url:common_submit_url,dataType:'json',
	    data:$("#"+formId).serialize(),
	    success: function(myData){
	    	//console.log(myData);
	    		layer.alert(myData.msg, {skin: 'layui-layer-molv',closeBtn: 0},function(){
		    		$('#my_modal_edit').modal('hide');
		    		window.location.reload();
		    		//refresh();
	    		});
	  	}
	});	
}
function setUserPass(ifPass){
    if("1"==ifPass){
        $("#edit_user_pass").show();
    }else{
        $("#edit_user_pass").hide();
    }
}

function changeMemberType(obj){
	var memberType = $(obj).val();
	if("org"==memberType){
		$("#_org").show();
		$("#_person").hide();
	}
	if("person"==memberType){
		$("#_org").hide();
		$("#_person").show();
	}
	if(""==memberType){
		$("#_org").hide();
		$("#_person").hide();
	}
}


/**
 *	用户名校验 
 */
function checkUserEname(formId){
	var userEnameStr ="#"+formId+"_login_username";
	var frm_checkName = "#"+formId+"_checkName";
	userEname = $(userEnameStr).val();
	if(strUtil.isNull($(userEnameStr).val())){
		layer.tips($(userEnameStr).attr("tip"), userEnameStr, {tips: 1});
		$(userEnameStr).focus();
		return;
	}
	var formUrl = ctx+"/trans/list/?doCode=dymicSql";
	//var dataP = {'member.w_memberEname':userEname,'modelTypes':'s_member'};
	var dataP = {'user.w_userEname':userEname,'modelTypes':'s_user'};
	var result;
	$.ajax({url: formUrl,type: 'get',data:dataP,cache: false,async:false,dataType:'json',
		success: function(data){result=data;},error:function(messg)  { alert("错误信息:连接服务器失败");}  
	});
	if(result.total>0){
		$(frm_checkName).show();
		$(userEnameStr).focus();
	}else{
		$(frm_checkName).hide();
	}
	console.log();
}

/**
 * 用户手机号校验
 * type 1 注册 2 找回密码 3 重新绑定手机号
 */
function checkUserMobile(formId,type){
	var mobile ="#"+formId+"_login_mobile";
	/**
	if(type=="3"){
		//判断是否和原手机号一样
		var oldMobile = $("#oldMobile").val();
		if(oldMobile==$(mobile).val()){
			layer.msg("新手机号不能与原手机号相同", {offset: '200px'});
			$(mobile).focus();
			return false;
		}
	}**/
	if(strUtil.isNull($(mobile).val())){
		layer.tips($(mobile).attr("tip"), mobile, {tips: 1});
		$(mobile).focus();
		return false;
	}
	//验证手机号长度
	if(!checkMobileLen($(mobile).val())){
		layer.msg("手机号位数不足11位", {offset: '200px'});
		$(mobile).focus();
		return false;
	}
	//验证手机号
	if (!checkmobile($(mobile).val())){
		layer.msg("请输入正确的手机号", {offset: '200px'});
		$(mobile).focus();
		return false;
	}
	var formUrl = ctx+"/trans/list/?doCode=dymicSql";
	//var dataP = {'member.w_mobile':$(mobile).val(),'modelTypes':'s_member'};
	var dataP = {'uctUser.w_mobile':$(mobile).val(),'modelTypes':'s_uctUser'};
	var result;
	$.ajax({url: formUrl,type: 'get',data:dataP,cache: false,async:false,dataType:'json',
		success: function(data){result=data;},error:function(messg)  { alert("错误信息:连接服务器失败");}  
	});
	if(result.total>0){
		if(type=="1"){
			layer.msg("该手机号已被绑定", {offset: '200px'});
			$(mobile).val("");
			return false;
		}else if(type=="2"){//找回密码填充userEname
			//$("#username").val(result.rows[0].memberEname);
		}else if(type=="3"){
			layer.msg("该手机号已被绑定", {offset: '200px'});
			return false;
		}
	}else{
		if(type=="2"){
			layer.msg("系统不存在该手机号", {offset: '200px'});
			$(mobile).val("");
			$(mobile).focus();
			return false;
		}
	}
	return true;
}

function myBack(){
	
}

</script>
